﻿using ARchGL.Platform.Core;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using ARchGL.Platform.EntityFrameworkCore;

namespace ARchGL.Platform.Mappings
{
    public class ProjectModelsMapping : IEntityTypeConfiguration<ProjectModels>
    {
        public void Configure(EntityTypeBuilder<ProjectModels> builder)
        {
            //builder.ToTable(MappingConsts.Prefix + nameof(ProjectModels));

            builder.Property(p => p.Name).HasMaxLength(100);
            builder.Property(p => p.CreatorUserName).HasMaxLength(64);
            builder.Property(p => p.ImageUrl).HasMaxLength(255);
            builder.Property(p => p.Path).HasMaxLength(1000);
        }
    }

    public class ProjectViewPortsMapping : IEntityTypeConfiguration<ProjectViewPorts>
    {
        public void Configure(EntityTypeBuilder<ProjectViewPorts> builder)
        {
            //builder.ToTable(MappingConsts.Prefix + nameof(ProjectViewPorts));

            builder.Property(p => p.Name).HasMaxLength(50);
            builder.Property(p => p.Path).HasMaxLength(2000);
            builder.Property(p => p.Url).HasMaxLength(255);
            builder.Property(p => p.Point).HasMaxLength(2000);
            builder.Property(p => p.ModelIdArray).HasMaxLength(255); 
            builder.Property(p => p.Description).HasMaxLength(255);
        }
    }

    public class ProjectModelGroupsMapping : IEntityTypeConfiguration<ProjectModelGroups>
    {
        public void Configure(EntityTypeBuilder<ProjectModelGroups> builder)
        {
            //builder.ToTable(MappingConsts.Prefix + nameof(ProjectModels));

            builder.Property(p => p.Name).HasMaxLength(100);
            builder.Property(p => p.CreatorUserName).HasMaxLength(64);
            builder.Property(p => p.ImageUrl).HasMaxLength(255);
        }
    }
}
